#ifndef _OBJECTS1_H_
#define _OBJECTS1_H_

#include <d3dx9.h>
#include "sprite.h"

#define ANIMATE_RATE 20
#define GROUND 224

class CObjects
{
public:
	CObjects();
	~CObjects();

	float pos_x;		// position
	float pos_y;		
	
	int width;
	int height;
	int reality;

	float v_x;		// velocity
	float v_y;		

	float v_x_last;  // last vx before stop

	int movingWay;  // move Left or Right
	int life;
	int anim;      // animate

	int isFalling;
	int havingStar;
	int CoinGot;

	int lowest;
	int lv;

	DWORD last_time;	 // this is to control the animate rate

	int posSpriteX; // start position in sprite file;
	int posSpriteY;

	virtual void RenderFrame(LPDIRECT3DDEVICE9 d3ddv, int Delta);
	virtual void LoadResources(LPDIRECT3DDEVICE9 d3ddv);
	virtual void Hitted(CObjects *);
	virtual void isJumpedOn(CObjects *);
	virtual void Touch(CObjects *);
	virtual void lvUp();
	virtual void lvDown();
	virtual void Die();
};
#endif